package com.che.software.testato.domain.entity;

import java.io.Serializable;

/**
 * Class representing a script.
 * 
 * @author Clement HELIOU (clement.heliou@che-software.com).
 * @copyright Che Software.
 * @license GNU General Public License.
 * @see Serializable
 * @since July, 2011.
 * 
 *        This file is part of Testato.
 * 
 *        Testato is free software: you can redistribute it and/or modify it
 *        under the terms of the GNU General Public License as published by the
 *        Free Software Foundation, either version 3 of the License, or (at your
 *        option) any later version.
 * 
 *        Testato is distributed in the hope that it will be useful, but WITHOUT
 *        ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *        FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 *        for more details.
 * 
 *        You should have received a copy of the GNU General Public License
 *        along with Testato. If not, see <http://www.gnu.org/licenses/>.
 * 
 *        Testato's logo is a creation of Arrioch
 *        (http://arrioch.deviantart.com/) and it's distributed under the terms
 *        of the Creative Commons License.
 */
public class Script implements Serializable {

	/**
	 * Constants.
	 */
	private static final long serialVersionUID = -1550544670718300281L;

	/**
	 * Members.
	 */
	private Integer depth, parentHierarchyId, parentScriptItem, scriptId;
	private String label;

	/**
	 * Getter for the private field value parentHierarchyId.
	 * 
	 * @return the parentHierarchyId field value.
	 */
	public Integer getParentHierarchyId() {
		return parentHierarchyId;
	}

	/**
	 * Setting a value to the parentHierarchyId field.
	 * 
	 * @param parentHierarchyId the value to set.
	 */
	public void setParentHierarchyId(Integer parentHierarchyId) {
		this.parentHierarchyId = parentHierarchyId;
	}

	/**
	 * Getter for the private field value scriptId.
	 * 
	 * @return the scriptId field value.
	 */
	public Integer getScriptId() {
		return scriptId;
	}

	/**
	 * Setting a value to the scriptId field.
	 * 
	 * @param scriptId the value to set.
	 */
	public void setScriptId(Integer scriptId) {
		this.scriptId = scriptId;
	}

	/**
	 * Getter for the private field value label.
	 * 
	 * @return the label field value.
	 */
	public String getLabel() {
		return label;
	}

	/**
	 * Setting a value to the label field.
	 * 
	 * @param label the value to set.
	 */
	public void setLabel(String label) {
		this.label = label;
	}

	/**
	 * Getter for the private field value depth.
	 * 
	 * @return the depth field value.
	 */
	public Integer getDepth() {
		return depth;
	}

	/**
	 * Setting a value to the depth field.
	 * 
	 * @param depth the value to set.
	 */
	public void setDepth(Integer depth) {
		this.depth = depth;
	}

	/**
	 * Getter for the private field value parentScriptItem.
	 * 
	 * @return the parentScriptItem field value.
	 */
	public Integer getParentScriptItem() {
		return parentScriptItem;
	}

	/**
	 * Setting a value to the parentScriptItem field.
	 * 
	 * @param parentScriptItem the value to set.
	 */
	public void setParentScriptItem(Integer parentScriptItem) {
		this.parentScriptItem = parentScriptItem;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((depth == null) ? 0 : depth.hashCode());
		result = prime * result + ((label == null) ? 0 : label.hashCode());
		result = prime * result + ((parentHierarchyId == null) ? 0 : parentHierarchyId.hashCode());
		result = prime * result + ((parentScriptItem == null) ? 0 : parentScriptItem.hashCode());
		result = prime * result + ((scriptId == null) ? 0 : scriptId.hashCode());
		return result;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Script other = (Script) obj;
		if (depth == null) {
			if (other.depth != null)
				return false;
		} else if (!depth.equals(other.depth))
			return false;
		if (label == null) {
			if (other.label != null)
				return false;
		} else if (!label.equals(other.label))
			return false;
		if (parentHierarchyId == null) {
			if (other.parentHierarchyId != null)
				return false;
		} else if (!parentHierarchyId.equals(other.parentHierarchyId))
			return false;
		if (parentScriptItem == null) {
			if (other.parentScriptItem != null)
				return false;
		} else if (!parentScriptItem.equals(other.parentScriptItem))
			return false;
		if (scriptId == null) {
			if (other.scriptId != null)
				return false;
		} else if (!scriptId.equals(other.scriptId))
			return false;
		return true;
	}
}